#include<stdio.h>
int main()
{
	int n, m;
	scanf_s("%d,", &n);
	scanf_s("%d", &m);
	for (n; n > 0; n--) {
		if (n / m == 0 && n / (m - 1) == 0)
			break;
	}
	if (n > 0)
		printf("%d\n", n);
	else
		printf("No\n");
	return 0;
}